import request from '@/utils/request'

// 获取Role
export function list(params) {
  return request({
    url: 'admin/role/list',
    method: 'get',
    params
  })
}

export function add(data) {
  return request({
    url: 'admin/role/add',
    method: 'post',
    data
  })
}

export function get(id) {
  return request({
    url: 'admin/role/detail',
    method: 'get',
    params: {
      id: id
    }
  })
}

export function getLevel(params) {
  return request({
    url: 'admin/auth/getLevel',
    method: 'get',
    params
  })
}

export function del(ids) {
  return request({
    url: 'admin/role/delete',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'admin/role/update',
    method: 'put',
    data
  })
}

export function editMenu(data) {
  return request({
    url: 'admin/auth/assign',
    method: 'post',
    data
  })
}

export default { add, edit, del, get, editMenu, getLevel }
